import java.util.concurrent.*;

/**
 * @author zhu
 * @date 2024-03-19
 */
public class MainTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {

        MyThread t1 = new MyThread(1,100) ;
        MyThread t2 = new MyThread(101,900) ;
        MyThread t3 = new MyThread(901,1000) ;

        t1.start() ;
        t2.start() ;
        t3.start() ;
        t1.join();
        t2.join();
        t3.join();

        int sum = t1.getResult() + t2.getResult() + t3.getResult();

        System.out.println("1-1000和为：" + sum);
    }
}
